package com.jtech.together.model;

import android.text.TextUtils;

import cn.bmob.v3.BmobUser;
import cn.bmob.v3.datatype.BmobGeoPoint;

/**
 * 系统当前登录的用户
 * Created by wuxubaiyang on 2017/5/10.
 */

public class UserModel extends BmobUser {
    private String nickname = "";//昵称
    private Integer sex = 0;//0未知 1男 2女
    private String bio = "";//个人简介
    private Long birthday = 0L;//生日
    private String avatar = "";//头像
    private BmobGeoPoint location = new BmobGeoPoint(0, 0);//位置对象
    private String address = "";//位置信息

    public UserModel(String objectId) {
        setObjectId(objectId);
    }

    public UserModel() {
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Long getBirthday() {
        return birthday;
    }

    public void setBirthday(Long birthday) {
        this.birthday = birthday;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public BmobGeoPoint getLocation() {
        return location;
    }

    public void setLocation(BmobGeoPoint location) {
        this.location = location;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getBio() {
        return bio;
    }

    public String getInfo() {
        if (TextUtils.isEmpty(bio)) {
            return (sex == 2 ? "她" : "他") + "很懒，什么都没写~";
        }
        return bio;
    }

    public void setBio(String bio) {
        this.bio = bio;
    }
}